#include "Wall.h"


Wall::Wall(GameState *gamestate) : PhysicalObject(gamestate)
{
	getBodyDef()->type = b2_staticBody;
	b2FixtureDef *fixDef = new b2FixtureDef;
	b2PolygonShape *shape = new b2PolygonShape;
	shape->SetAsBox(0.2, 3);
	fixDef->shape = shape;
	fixDef->density = 2.0f;
	fixDef->restitution = 0.2f;
	fixDef->friction = 1.0f;
	addFixtureDef(fixDef);
	setRotation(0.0f);

	setColor(0.3f, 0.4f, 0.4f);

	addProperty("wall4");
}


Wall::~Wall(void)
{
}


void Wall::update(double dt){
	if(m_gameState->getCurrentLevel() >= 4){
		setVisible(true);
	}else{
		setVisible(false);
	}

	if(m_gameState->getCurrentLevel() == 5){
		setPosition(b2Vec2(-4, 3.0f));
	}else{
		setPosition(b2Vec2(-5, 0));
	}
}